package com.mallcloud.mall.mall.api.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.util.Optional;

@ApiModel(value = "ProValueCardGiven", description = "储值卡转赠过程")
@Data
@ToString
public class ProValueCardGiven {

	@ApiModelProperty("转赠的会员卡号")
	private String cardNo;
	@ApiModelProperty("转赠的手机号")
	private String mobile;
	@ApiModelProperty("转赠的储值卡卡号")
	private String valueCardNo;

	@ApiModelProperty(value = "过程返回id", hidden = true)
	private Integer messageId;
	@ApiModelProperty(value = "过程返回信息", hidden = true)
	private String message;

	public boolean isSuccess() {
		return Optional.ofNullable(this.messageId).map(x -> x.equals(0)).orElse(false);
	}
}
